﻿<!DOCTYPE html>
<html dir="rtl">
<head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
    <script type="text/javascript" src="jquery-1.7.2.js"></script>
    <script type="text/javascript" src="GraphicsEngine.js"></script>
</head>
<body>
<table style="border-style: none;">
    <tr>
        <td style="border-style:none;">
            <button id="controls" style="width: 100px;font-size: 12px">ازرار التحكم</button>
        </td>
        <td style="border-style: none;">
            <button id="pause" style="width: 100px;font-size: 12px">ايقاف اللعبة</button>
        </td>
        <td style="border-style: none;">
            <label for="sound" style="width: 100px;font-size: 12px">الصوت</label> <input type="checkbox" id="sound"
                                                                                         checked="false"/>
        </td>
    </tr>
</table>
<canvas id="game_canvas" width="830" height="500" title="Objects on the drawing stack: 0" dir="ltr">
    المتصفح الذى تعمل به قديم يرجى تنزيل متصفح google chrome للحصول على افضل اداء
</canvas>
<script type="text/javascript">
$(document).ready(function ()
        {
            var graphics = document.getElementById("game_canvas").getContext("2d");
            var WIDTH = game_canvas.width;
            var HEIGHT = game_canvas.height;
            var activeScene = null;
            var game = new Game(game_canvas);
            var score = 0;
            var textSpeed = 0.3;
            var fadeSpeed = 0.01;
            sound.onchange = function ()
            {
                if (sound.checked)
                    game.resumeSound();
                else
                    game.pauseSound();
            };
            pause.onclick = function ()
            {
                if (pause.innerHTML === "ايقاف اللعبة")
                {
                    game.pauseGame();
                    pause.innerHTML = "تشغيل اللعبة";
                }
                else
                {
                    game.resumeGame();
                    pause.innerHTML = "ايقاف اللعبة";
                }

            };
            controls.onclick = function ()
            {
                alert("استخدم الاسهم للتحرك و زر المسافة للضرب");
            }
            var scene1 = game.addScene("scene1", 10);
            scene1.loadImage("lesson1intro.png", "background", 1, 0, 0, 0, -1, -1, 0, 0, WIDTH, HEIGHT, "auto", 0, 0, true, false, function ()
            {
                scene1.loadImage("start_button.png", "start", 1, 0, 0, 0, -1, -1, 90, 450, -1, -1, "pointer", 0, 0, true, false, function ()
                {
                    scene1.registerEventHandler("start", "onmouseover", function ()
                    {
                        scene1.getObjectById("start").initialAlpha = 0.5;
                    });
                    scene1.registerEventHandler("start", "onmouseout", function ()
                    {
                        scene1.getObjectById("start").initialAlpha = 1;
                    });
                    scene1.registerEventHandler("start", "onclick", function ()
                    {
                        game.nextScene()
                    });
                });
            });
            var scene2 = game.addScene("scene2", 30);
            scene2.loadImage("synapses.jpg", "background", 1, 0, 0, 0, -1, -1, 0, 0, WIDTH, HEIGHT, "auto", 0, 0, true, false, function ()
            {
                for (var i = 0; i < 500; i++)
                {
                    scene2.createCircle("circle" + i, "#26C5FF", 1, 0, 50, 50, 1, 1, 1, 0, Math.PI * 2, true, true, Math.random() * 10 + 5, Math.random() * 10 + 5, true, true);
                }
                scene2.loadImage("albert_einstein_professor.png", "einstein", 1, 0, 0, 0, -1, -1, 500, 200, -1, -1, "auto", 0, 0, true, false, function ()
                {
                    scene2.createCircle("mini", "white", 0, 0.03, 590, 550, 1, 0.7, 20, 0, Math.PI * 2, true, true, 0, 0, true, true);
                    scene2.createCircle("dialog", "white", 0, 0.03, 400, 550, 1, 0.5, 200, 0, Math.PI * 2, true, true, 0, 0, true, true);
                    scene2.loadImage("start_game.png", "start_game", 1, 0, 0, 0, -1, -1, 350, 335, -1, -1, "pointer", 0, 0, true, false, function ()
                    {
                        scene2.registerEventHandler("start_game", "onmouseover", function ()
                        {
                            scene2.getObjectById("start_game").initialAlpha = 0.5;
                        });
                        scene2.registerEventHandler("start_game", "onmouseout", function ()
                        {
                            scene2.getObjectById("start_game").initialAlpha = 1;
                        });
                        scene2.registerEventHandler("start_game", "onclick", function ()
                        {
                            game.nextScene();
                        });
                        scene2.createText("Hello, today you will learn about the nervous system, " +
                                "What is that you say?.It is one of the most important systems " +
                                "in your body,it is required for many functions " +
                                "like detecting pain when you touch a hot stove " +
                                "the nervous system is comprised of the brain, the spinal cord " +
                                "and the nerve endings spread all over the body.", "text", "blue", "14px consolas", 0, 0.8, 250, 230, true, false, 0, 0, true, true, 250);
                        scene2.scheduleSound("text", "intro_voice.mp3", false);
                    });
                });
            });
            var scene3 = game.addScene("scene3", 40);
            scene3.scheduleSound("background", "game_song.mp3", true);
            scene3.loadImage("background.png", "background", 1, 0, 0, 0, -1, -1, 0, 0, WIDTH, HEIGHT, "auto", 0, 0, true, false, function ()
            {
                scene3.loadImage("mario.png", "actor", 1, 0, 0, 0, -1, -1, 400, 450, -1, -1, "auto", 0, 0, true, false, function ()
                {
                    scene3.loadImage("mario_reverse.png", "actor_reverse", 0, 0, 0, 0, -1, -1, 400, 450, -1, -1, "auto", 0, 0, true, false);
                });
                scene3.loadImage("boss.png", "boss", 0, 0.05, 0, 0, -1, -1, 400, 10, -1, -1, "auto", 0, 0, true, false, function ()
                {
                    scene3.createCircle("boss_talk", "white", 0, fadeSpeed, 260, 200, 1, 0.5, 150, 0, Math.PI * 2, true, false, 0, 0, true, true);
                    scene3.createText("Hello mario, I have been expecting you", "boss_talk_text", "green", "14px courier", 0, textSpeed, 160, 60, true, false, 0, 0, true, true, 150);
                    scene3.createCircle("mario_talk", "white", 0, fadeSpeed, 260, 800, 1, 0.5, 150, 0, Math.PI * 2, true, false, 0, 0, true, true);
                    scene3.createText("Give her up bowser, where is my princess?", "mario_talk_text", "green", "14px courier", 0, textSpeed, 160, 350, true, false, 0, 0, true, true, 150);
                    scene3.createCircle("boss_talk", "white", 0, fadeSpeed, 260, 200, 1, 0.5, 150, 0, Math.PI * 2, true, false, 0, 0, true, true);
                    scene3.createText("Princess!, ah you mean this princess, by all means please come and save her, just kidding " +
                            "you will never see princess peach ever again mario.", "boss_talk_text", "green", "14px courier", 0, textSpeed, 160, 60, true, false, 0, 0, true, true, 150, function ()
                    {
                        scene3.loadImage("princess.png", "princess", 0, 0.1, 0, 0, -1, -1, 500, 10, -1, -1, "auto", 0, 0, true, false, function ()
                        {
                            scene3.createCircle("boss_talk", "white", 0, fadeSpeed, 260, 200, 1, 0.5, 150, 0, Math.PI * 2, true, false, 0, 0, true, true);
                            scene3.createText("Me and your princess will be safely hidden at the brain if you want to ever see her again "
                                    + "come find her, of coarse my loyal nerve cells will tear you to pieces first, MWAHAHAHAHA Whooosh", "boss_talk_text", "green", "14px courier", 0, textSpeed, 160, 60, true, false, 0, 0, true, true, 150, function ()
                            {
                                scene3.loadImage("background.png", "background", 1, 0, 0, 0, -1, -1, 0, 0, WIDTH, HEIGHT, "auto", 0, 0, true, false, function ()
                                {
                                    scene3.loadImage("mario.png", "actor", 1, 0, 0, 0, -1, -1, 400, 450, -1, -1, "auto", 0, 0, true, false, function ()
                                    {
                                        scene3.loadImage("mario_reverse.png", "actor_reverse", 0, 0, 0, 0, -1, -1, 400, 450, -1, -1, "auto", 0, 0, true, false);
                                        scene3.createCircle("mario_talk", "white", 0, fadeSpeed, 260, 800, 1, 0.5, 150, 0, Math.PI * 2, true, false, 0, 0, true, true);
                                        scene3.createText("Where did he go,I must fight my way to get to the brain at the center of the central nervous system and save my princess, I should also look out for luigi he might have some useful information for me, hang on princess I am on my way.", "mario_talk_text", "green", "14px courier", 0, textSpeed, 160, 350, true, false, 0, 0, true, true, 150, function ()
                                        {
                                            scene3.loadImage("arrow.png", "arrow", 0, 0.1, 0, 0, -1, -1, 720, 390, -1, -1, "pointer", 0, 0, true, false, function ()
                                            {
                                                scene3.registerEventHandler("arrow", "onclick", function ()
                                                {
                                                    game.nextScene();
                                                });
                                            });
                                        });
                                    });
                                });
                            });
                        });
                    });
                });
            });
            var scene4 = game.addScene("scene4", 40);
            scene4.scheduleSound("background", "game_song.mp3", true);
            scene4.loadImage("background.png", "background", 1, 0, 0, 0, -1, -1, 0, 0, WIDTH, HEIGHT, "auto", 0, 0, true, false, function ()
            {
                scene4.loadImage("mario.png", "actor", 1, 0, 0, 0, -1, -1, 10, 220, -1, -1, "auto", 0, 0, true, false, function ()
                {
                    scene4.loadImage("mario_reverse.png", "actor_reverse", 0, 0, 0, 0, -1, -1, 10, 220, -1, -1, "auto", 0, 0, true, false, function ()
                    {
                        scene4.createText(score, "score", "green", "36px consolas bold", 1, 0, 10, 30, true, false, 0, 0, false, false, 100);
                        scene4.registerEventHandler("actor", "onkeydown", function (event)
                        {
                            var actor = scene4.getObjectById("actor");
                            var actorReverse = scene4.getObjectById("actor_reverse");
                            if (event.keyCode === 39)
                            {
                                actor.initialAlpha = 1;
                                actorReverse.initialAlpha = 0;
                                actor.animateX = 5;
                                actorReverse.animateX = 5;
                            }
                            else if (event.keyCode === 37)
                            {
                                actor.initialAlpha = 0;
                                actorReverse.initialAlpha = 1;
                                actor.animateX = -5;
                                actorReverse.animateX = -5;
                            }
                            else if (event.keyCode === 38)
                            {
                                actor.animateY = -5;
                                actorReverse.animateY = -5;
                            }
                            else if (event.keyCode === 40)
                            {
                                actor.animateY = 5;
                                actorReverse.animateY = 5;
                            }
                            else if (event.keyCode === 32)
                            {
                                scene4.loadImage("bullet.png", "bullet", 1, 0, 0, 0, -1, -1, actor.dstX, actor.dstY + (actor.dstHeight / 2), -1, -1, "auto", 10, 0, false, true, function ()
                                {
                                    scene4.registerEventHandler("bullet", "oncollision", function (collidedIndex, collidedWith, thisIndex, thisObject)
                                    {
                                        if (collidedWith.id === "mob")
                                        {
                                            scene4.loadImage("explosion.png", "explosion", 1, -0.01, 0, 0, -1, -1, collidedWith.dstX, collidedWith.dstY, 50, 50, "auto", 0, 0, true, true);
                                            scene4.deleteObject(collidedIndex);
                                            if (collidedIndex > thisIndex)
                                                scene4.deleteObject(thisIndex);
                                            else
                                                scene4.deleteObject(thisIndex - 1);
                                            score += 10;
                                            scene4.deleteAllObjects("score");
                                            scene4.createText(score, "score", "green", "36px consolas bold", 1, 0, 10, 30, true, false, 0, 0, false, false, 100);
                                            if (scene4.getAllObjectsById("mob").length === 0)
                                            {
                                                scene4.scheduleSound("actor", "win_sound.mp3", false);
                                                actor.dstX = 10;
                                                actor.dstY = 450;
                                                actorReverse.dstX = 10;
                                                actorReverse.dstY = 450;
                                                scene4.loadImage("Luigi_reverse.png", "luigi", 0, 0.01, 0, 0, -1, -1, 700, 440, -1, -1, "auto", 0, 0, true, false, function ()
                                                {
                                                    scene4.createCircle("luigi_talk", "white", 0, fadeSpeed, 550, 700, 1, 0.5, 200, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                    scene4.createText("Hey mario I dont have much time you need to watch out, Bowser is pulling out the big guns, " +
                                                            "he is sending the 12 pairs of cranial nerves to kill you, " +
                                                            "you have to escape NOW!!", "luigi_talk_text", "green", "14px consolas", 0, textSpeed, 400, 300, true, false, 0, 0, true, true, 250);
                                                    scene4.createCircle("mario_talk", "white", 0, fadeSpeed, 150, 700, 1, 0.5, 150, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                    scene4.createText("12 pairs or no 12 pairs i have to save princess peach, what do these 12 pairs of cranial nerves do anyway?", "mario_talk_text", "green", "14px consolas", 0, textSpeed, 50, 310, true, false, 0, 0, true, true, 180);
                                                    scene4.createCircle("luigi_talk", "white", 0, fadeSpeed, 550, 700, 1, 0.5, 200, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                    scene4.createText("They control the sensory and motor functions of the body like smell, taste, " +
                                                            "hearing and vision as well as general sensation. So wherever you are in the body they " +
                                                            "will find you that is why you should hurry up and leave.", "luigi_talk_text", "green", "14px consolas", 0, textSpeed, 400, 300, true, false, 0, 0, true, true, 250);
                                                    scene4.createCircle("mario_talk", "white", 0, fadeSpeed, 150, 700, 1, 0.5, 150, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                    scene4.createText("I told you i am not leaving, but thanks luigi for the heads up i will watch out.", "mario_talk_text", "green", "14px consolas", 0, textSpeed, 50, 310, true, false, 0, 0, true, true, 180);
                                                    scene4.loadImage("arrow.png", "arrow", 0, 0.1, 0, 0, -1, -1, 720, 390, -1, -1, "pointer", 0, 0, true, false, function ()
                                                    {
                                                        scene4.registerEventHandler("arrow", "onclick", function ()
                                                        {
                                                            game.nextScene();
                                                        });
                                                    });
                                                });
                                            }
                                        }
                                    });
                                });
                            }
                        });
                        scene4.registerEventHandler("actor", "onkeyup", function (event)
                        {
                            var actor = scene4.getObjectById("actor");
                            var actorReverse = scene4.getObjectById("actor_reverse");
                            if (event.keyCode === 39 || event.keyCode === 37)
                            {
                                actor.animateX = 0;
                                actorReverse.animateX = 0;
                            }
                            else if (event.keyCode === 38 || event.keyCode === 40)
                            {
                                actor.animateY = 0;
                                actorReverse.animateY = 0;
                            }
                        });
                        scene4.registerEventHandler("actor", "oncollision", function (collidedIndex, collidedWith, thisIndex, thisObject)
                        {
                            if (collidedWith.id === "mob")
                            {
                                var stack = scene4.getDrawStack();
                                var bombIndex = -1;
                                for (var i = 0; i < stack.length; i++)
                                {
                                    if (stack[i].id === "explosion")
                                        bombIndex = i;
                                }
                                scene4.loadImage("explosion.png", "explosion", 1, -0.01, 0, 0, -1, -1, collidedWith.dstX, collidedWith.dstY, 50, 50, "auto", 0, 0, true, true, function ()
                                {
                                    scene4.scheduleSound("actor", "lose_sound.mp3", false);
                                    thisObject.dstX = 10;
                                    thisObject.dstY = 220;
                                    var reverse = scene4.getObjectById("actor_reverse");
                                    reverse.dstX = 10;
                                    reverse.dstY = 220;
                                    scene4.deleteAllObjects("mob");
                                    if (score - 50 >= 0)
                                        score -= 50;
                                    else
                                        score = 0;
                                    scene4.deleteAllObjects("score");
                                    scene4.createText(score, "score", "green", "36px consolas bold", 1, 0, 10, 30, true, false, 0, 0, false, false, 100);
                                    setTimeout(function ()
                                    {
                                        for (var i = 0; i < 10; i++)
                                        {
                                            scene4.loadImage("monster.png", "mob", 1, 0, 0, 0, -1, -1, (Math.random() * (game.canvas.width - 100)) + 50, (Math.random() * (game.canvas.height - 40)), -1, -1, "auto", 5, 0, true, false);
                                        }
                                    }, 5000);
                                });
                            }
                        });
                        for (var i = 0; i < 10; i++)
                        {
                            scene4.loadImage("monster.png", "mob", 1, 0, 0, 0, -1, -1, (Math.random() * (game.canvas.width - 100)) + 50, (Math.random() * (game.canvas.height - 40)), -1, -1, "auto", 5, 0, true, false);
                        }
                    });
                });
            });
            var scene5 = game.addScene("scene5", 40);
            scene5.scheduleSound("background", "game_song_2.mp3", true);
            scene5.loadImage("background_scene2.png", "background", 1, 0, 0, 0, -1, -1, 0, 0, game_canvas.width, game_canvas.height, "auto", 0, 0, true, true, function ()
            {
                scene5.loadImage("mario.png", "actor", 1, 0, 0, 0, -1, -1, 10, 220, -1, -1, "auto", 0, 0, true, false, function ()
                {
                    scene5.loadImage("mario_reverse.png", "actor_reverse", 0, 0, 0, 0, -1, -1, 10, 220, -1, -1, "auto", 0, 0, true, false);
                    scene5.createText(score, "score", "green", "36px consolas bold", 1, 0, 10, 30, true, false, 0, 0, false, false, 100);
                    scene5.registerEventHandler("actor", "onkeydown", function ()
                    {
                        var actor = scene5.getObjectById("actor");
                        var actorReverse = scene5.getObjectById("actor_reverse");
                        if (event.keyCode === 39)
                        {
                            actor.initialAlpha = 1;
                            actorReverse.initialAlpha = 0;
                            actor.animateX = 5;
                            actorReverse.animateX = 5;
                        }
                        else if (event.keyCode === 37)
                        {
                            actor.initialAlpha = 0;
                            actorReverse.initialAlpha = 1;
                            actor.animateX = -5;
                            actorReverse.animateX = -5;
                        }
                        else if (event.keyCode === 38)
                        {
                            actor.animateY = -5;
                            actorReverse.animateY = -5;
                        }
                        else if (event.keyCode === 40)
                        {
                            actor.animateY = 5;
                            actorReverse.animateY = 5;
                        }
                        else if (event.keyCode === 32)
                        {
                            scene5.loadImage("bullet.png", "bullet", 1, 0, 0, 0, -1, -1, actor.dstX, actor.dstY + (actor.dstHeight / 2), -1, -1, "auto", 10, 0, false, true, function ()
                            {
                                scene5.registerEventHandler("bullet", "oncollision", function (collidedIndex, collidedWith, thisIndex, thisObject)
                                {
                                    if (collidedWith.id === "mob")
                                    {
                                        scene5.loadImage("explosion.png", "explosion", 1, -0.01, 0, 0, -1, -1, collidedWith.dstX, collidedWith.dstY, 50, 50, "auto", 0, 0, true, true);
                                        scene5.deleteObject(collidedIndex);
                                        if (collidedIndex > thisIndex)
                                            scene5.deleteObject(thisIndex);
                                        else
                                            scene5.deleteObject(thisIndex - 1);
                                        score += 20;
                                        scene5.deleteAllObjects("score");
                                        scene5.createText(score, "score", "green", "36px consolas bold", 1, 0, 10, 30, true, false, 0, 0, false, false, 100);
                                        if (scene5.getAllObjectsById("mob").length === 0)
                                        {
                                            scene5.scheduleSound("actor", "win_sound.mp3", false);
                                            actor.dstX = 10;
                                            actor.dstY = 450;
                                            actorReverse.dstX = 10;
                                            actorReverse.dstY = 450;
                                            scene5.loadImage("Luigi_reverse.png", "luigi", 0, 0.01, 0, 0, -1, -1, 700, 440, -1, -1, "auto", 0, 0, true, false, function ()
                                            {
                                                scene5.createCircle("luigi_talk", "white", 0, fadeSpeed, 560, 700, 1, 0.5, 200, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene5.createText("Mario is it you?, good i thought those cranial nerves finished you off, but you are alive. I am afraid " +
                                                        "i have more bad news, bowser has sent more nerve cells to intercept you " +
                                                        "at the grey matter in the spinal cord.", "luigi_talk_text", "green", "14px consolas", 0, textSpeed, 400, 300, true, false, 0, 0, true, true, 250);
                                                scene5.createCircle("mario_talk", "white", 0, fadeSpeed, 180, 700, 1, 0.5, 180, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene5.createText("I know the spinal cord controls reflex actions and is running through the vertebral column, " +
                                                        "but where is that grey matter luigi?", "mario_talk_text", "green", "14px consolas", 0, textSpeed, 50, 310, true, false, 0, 0, true, true, 180);
                                                scene5.createCircle("luigi_talk", "white", 0, fadeSpeed, 560, 700, 1, 0.5, 200, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene5.createText("the grey matter is inside the spinal cord it is formed in the shape of the letter 'H'," +
                                                        "if you reach there be on guard as there are many nerve cells waiting to ambush you there.", "luigi_talk_text", "green", "14px consolas", 0, textSpeed, 400, 300, true, false, 0, 0, true, true, 250);
                                                scene5.createCircle("mario_talk", "white", 0, fadeSpeed, 180, 700, 1, 0.5, 180, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene5.createText("look out for the letter 'H' thanks luigi, but what do the nerve cells look like?", "mario_talk_text", "green", "14px consolas", 0, textSpeed, 50, 310, true, false, 0, 0, true, true, 180);
                                                scene5.createCircle("luigi_talk", "white", 0, fadeSpeed, 560, 700, 1, 0.5, 200, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene5.createText("nerve cells are composed of cell body, dendrites, axon and myelin sheath. I know you cant visualise it so i took " +
                                                        "a photo of a nerve cell when it wasn't looking here you are.", "luigi_talk_text", "green", "14px consolas", 0, textSpeed, 400, 300, true, false, 0, 0, true, true, 250);
                                                scene5.loadImage("nerve_cell.jpg", "nerve_cell", 0, fadeSpeed, 0, 0, -1, -1, 200, 50, 300, 200, "auto", 0, 0, true, false);
                                                scene5.loadImage("arrow.png", "arrow", 0, 0.1, 0, 0, -1, -1, 720, 390, -1, -1, "pointer", 0, 0, true, false, function ()
                                                {
                                                    scene5.registerEventHandler("arrow", "onclick", function ()
                                                    {
                                                        game.nextScene();
                                                    });
                                                });
                                            });
                                        }
                                    }
                                });
                            });
                        }
                    });
                    scene5.registerEventHandler("actor", "onkeyup", function (event)
                    {
                        var actor = scene5.getObjectById("actor");
                        var actorReverse = scene5.getObjectById("actor_reverse");
                        if (event.keyCode === 39 || event.keyCode === 37)
                        {
                            actor.animateX = 0;
                            actorReverse.animateX = 0;
                        }
                        else if (event.keyCode === 38 || event.keyCode === 40)
                        {
                            actor.animateY = 0;
                            actorReverse.animateY = 0;
                        }

                    });
                    scene5.registerEventHandler("actor", "oncollision", function (collidedIndex, collidedWith, thisIndex, thisObject)
                    {
                        if (collidedWith.id === "mob")
                        {
                            var stack = scene5.getDrawStack();
                            var bombIndex = -1;
                            for (var i = 0; i < stack.length; i++)
                            {
                                if (stack[i].id === "explosion")
                                    bombIndex = i;
                            }
                            scene5.loadImage("explosion.png", "explosion", 1, -0.01, 0, 0, -1, -1, collidedWith.dstX, collidedWith.dstY, 50, 50, "auto", 0, 0, true, true, function ()
                            {
                                scene5.scheduleSound("actor", "lose_sound.mp3", false);
                                thisObject.dstX = 10;
                                thisObject.dstY = 220;
                                var reverse = scene5.getObjectById("actor_reverse");
                                reverse.dstX = 10;
                                reverse.dstY = 220;
                                scene5.deleteAllObjects("mob");
                                if (score - 100 >= 0)
                                    score -= 100;
                                else
                                    score = 0;
                                scene5.deleteAllObjects("score");
                                scene5.createText(score, "score", "green", "36px consolas bold", 1, 0, 10, 30, true, false, 0, 0, false, false, 100);
                                setTimeout(function ()
                                {
                                    for (var i = 0; i < 24; i++)
                                    {
                                        scene5.loadImage("mob_2.png", "mob", 1, 0, 0, 0, -1, -1, 150, 150, -1, -1, "auto", (Math.random() * 5) + 5, Math.random() * 5, true, false);
                                    }
                                }, 5000);
                            });
                        }
                    });
                    for (var i = 0; i < 24; i++)
                    {
                        scene5.loadImage("mob_2.png", "mob", 1, 0, 0, 0, -1, -1, 150, 150, -1, -1, "auto", (Math.random() * 5) + 5, Math.random() * 5, true, false);
                    }
                });
            });
            var scene6 = game.addScene("scene6", 40);
            scene6.scheduleSound("background", "game_song_3.mp3", true);
            scene6.loadImage("grey_matter.png", "background", 1, 0, 0, 0, -1, -1, 0, 0, game_canvas.width, game_canvas.height, "auto", 0, 0, true, false, function ()
            {
                scene6.loadImage("mario.png", "actor", 1, 0, 0, 0, -1, -1, 10, 220, -1, -1, "auto", 0, 0, true, false, function ()
                {
                    scene6.loadImage("mario_reverse.png", "actor_reverse", 0, 0, 0, 0, -1, -1, 10, 220, -1, -1, "auto", 0, 0, true, false);
                    scene6.createText(score, "score", "green", "36px consolas bold", 1, 0, 10, 30, true, false, 0, 0, false, false, 100);
                    scene6.registerEventHandler("actor", "onkeydown", function ()
                    {
                        var actor = scene6.getObjectById("actor");
                        var actorReverse = scene6.getObjectById("actor_reverse");
                        if (event.keyCode === 39)
                        {
                            actor.initialAlpha = 1;
                            actorReverse.initialAlpha = 0;
                            actor.animateX = 5;
                            actorReverse.animateX = 5;
                        }
                        else if (event.keyCode === 37)
                        {
                            actor.initialAlpha = 0;
                            actorReverse.initialAlpha = 1;
                            actor.animateX = -5;
                            actorReverse.animateX = -5;
                        }
                        else if (event.keyCode === 38)
                        {
                            actor.animateY = -5;
                            actorReverse.animateY = -5;
                        }
                        else if (event.keyCode === 40)
                        {
                            actor.animateY = 5;
                            actorReverse.animateY = 5;
                        }
                        else if (event.keyCode === 32)
                        {
                            scene6.loadImage("bullet.png", "bullet", 1, 0, 0, 0, -1, -1, actor.dstX, actor.dstY + (actor.dstHeight / 2), -1, -1, "auto", 10, 0, false, true, function ()
                            {
                                scene6.registerEventHandler("bullet", "oncollision", function (collidedIndex, collidedWith, thisIndex, thisObject)
                                {
                                    if (collidedWith.id === "mob")
                                    {
                                        scene6.loadImage("explosion.png", "explosion", 1, -0.01, 0, 0, -1, -1, collidedWith.dstX, collidedWith.dstY, 50, 50, "auto", 0, 0, true, true);
                                        scene6.deleteObject(collidedIndex);
                                        if (collidedIndex > thisIndex)
                                            scene6.deleteObject(thisIndex);
                                        else
                                            scene6.deleteObject(thisIndex - 1);
                                        score += 30;
                                        scene6.deleteAllObjects("score");
                                        scene6.createText(score, "score", "green", "36px consolas bold", 1, 0, 10, 30, true, false, 0, 0, false, false, 100);
                                        if (scene6.getAllObjectsById("mob").length === 0)
                                        {
                                            scene6.scheduleSound("actor", "win_sound.mp3", false);
                                            actor.dstX = 10;
                                            actor.dstY = 450;
                                            actorReverse.dstX = 10;
                                            actorReverse.dstY = 450;
                                            scene6.loadImage("Luigi_reverse.png", "luigi", 0, 0.01, 0, 0, -1, -1, 700, 440, -1, -1, "auto", 0, 0, true, false, function ()
                                            {
                                                scene6.createCircle("luigi_talk", "white", 0, fadeSpeed, 560, 700, 1, 0.5, 200, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene6.createText("Mario great i found you ,few....few...few...", "luigi_talk_text", "green", "14px consolas", 0, textSpeed, 400, 300, true, false, 0, 0, true, true, 250);
                                                scene6.createCircle("mario_talk", "white", 0, fadeSpeed, 180, 700, 1, 0.5, 180, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene6.createText("Catch your breath luigi what is wrong?", "mario_talk_text", "green", "14px consolas", 0, textSpeed, 50, 310, true, false, 0, 0, true, true, 180);
                                                scene6.createCircle("luigi_talk", "white", 0, fadeSpeed, 560, 700, 1, 0.5, 200, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene6.createText("I was being chased by some of bowser's henchcells, i guess i lost them. On " +
                                                        "the bright side i found where bowser is.", "luigi_talk_text", "green", "14px consolas", 0, textSpeed, 400, 300, true, false, 0, 0, true, true, 250);
                                                scene6.createCircle("mario_talk", "white", 0, fadeSpeed, 180, 700, 1, 0.5, 180, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene6.createText("I already know he is hiding in the brain luigi.", "mario_talk_text", "green", "14px consolas", 0, textSpeed, 50, 310, true, false, 0, 0, true, true, 180);
                                                scene6.createCircle("luigi_talk", "white", 0, fadeSpeed, 560, 700, 1, 0.5, 200, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene6.createText("Yes, but the brain has many rooms and i bet he booby trapped them all. " +
                                                        "There is the left and right cerebral hemispheres, the cerebellum and the medulla oblongata. " +
                                                        "I just found out that he is hiding in the right cerebral hemisphere.", "luigi_talk_text", "green", "14px consolas", 0, textSpeed, 400, 300, true, false, 0, 0, true, true, 250);
                                                scene6.createCircle("mario_talk", "white", 0, fadeSpeed, 180, 700, 1, 0.5, 180, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene6.createText("That is great luigi how did you find that out?", "mario_talk_text", "green", "14px consolas", 0, textSpeed, 50, 310, true, false, 0, 0, true, true, 180);
                                                scene6.createCircle("luigi_talk", "white", 0, fadeSpeed, 560, 700, 1, 0.5, 200, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene6.createText("Simple, i was walking around the left arm when bowser's security cameras found me, and since the RIGHT brain hemisphere " +
                                                        "controls the LEFT side of the body and the LEFT brain hemisphere controls the RIGHT " +
                                                        "side of the body then he must be in the RIGHT HEMISPHERE, you should have paid attention in biology class mario.", "luigi_talk_text", "green", "14px consolas", 0, textSpeed, 400, 300, true, false, 0, 0, true, true, 250);
                                                scene6.createCircle("mario_talk", "white", 0, fadeSpeed, 180, 700, 1, 0.5, 180, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene6.createText("I am sorry luigi, i guess i never thought that i would ever be " +
                                                        "chasing a psycho monster hiding INSIDE SOMEONE's BODY !!! ", "mario_talk_text", "green", "14px consolas", 0, textSpeed, 50, 310, true, false, 0, 0, true, true, 180);
                                                scene6.createCircle("luigi_talk", "white", 0, fadeSpeed, 560, 700, 1, 0.5, 200, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene6.createText("HA HA HA ...", "luigi_talk_text", "green", "14px consolas", 0, textSpeed, 400, 300, true, false, 0, 0, true, true, 250);
                                                scene6.createCircle("mario_talk", "white", 0, fadeSpeed, 180, 700, 1, 0.5, 180, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene6.createText("Ok luigi, here goes nothing i am going in, are you coming with me?", "mario_talk_text", "green", "14px consolas", 0, textSpeed, 50, 310, true, false, 0, 0, true, true, 180);
                                                scene6.createCircle("luigi_talk", "white", 0, fadeSpeed, 560, 700, 1, 0.5, 200, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene6.createText("no i will hang back here and make sure you dont get cornered.", "luigi_talk_text", "green", "14px consolas", 0, textSpeed, 400, 300, true, false, 0, 0, true, true, 250);
                                                scene6.createCircle("mario_talk", "white", 0, fadeSpeed, 180, 700, 1, 0.5, 180, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                                scene6.createText("Ok wish me luck.", "mario_talk_text", "green", "14px consolas", 0, textSpeed, 50, 310, true, false, 0, 0, true, true, 180);
                                                scene6.loadImage("arrow.png", "arrow", 0, 0.1, 0, 0, -1, -1, 720, 390, -1, -1, "pointer", 0, 0, true, false, function ()
                                                {
                                                    scene6.registerEventHandler("arrow", "onclick", function ()
                                                    {
                                                        game.nextScene();
                                                    });
                                                });
                                            });
                                        }
                                    }
                                });
                            });
                        }
                    });
                    scene6.registerEventHandler("actor", "onkeyup", function (event)
                    {
                        var actor = scene6.getObjectById("actor");
                        var actorReverse = scene6.getObjectById("actor_reverse");
                        if (event.keyCode === 39 || event.keyCode === 37)
                        {
                            actor.animateX = 0;
                            actorReverse.animateX = 0;
                        }
                        else if (event.keyCode === 38 || event.keyCode === 40)
                        {
                            actor.animateY = 0;
                            actorReverse.animateY = 0;
                        }

                    });
                    scene6.registerEventHandler("actor", "oncollision", function (collidedIndex, collidedWith, thisIndex, thisObject)
                    {
                        if (collidedWith.id === "mob")
                        {
                            var stack = scene6.getDrawStack();
                            var bombIndex = -1;
                            for (var i = 0; i < stack.length; i++)
                            {
                                if (stack[i].id === "explosion")
                                    bombIndex = i;
                            }
                            scene6.loadImage("explosion.png", "explosion", 1, -0.01, 0, 0, -1, -1, collidedWith.dstX, collidedWith.dstY, 50, 50, "auto", 0, 0, true, true, function ()
                            {
                                scene6.scheduleSound("actor", "lose_sound.mp3", false);
                                thisObject.dstX = 10;
                                thisObject.dstY = 220;
                                var reverse = scene6.getObjectById("actor_reverse");
                                reverse.dstX = 10;
                                reverse.dstY = 220;
                                scene6.deleteAllObjects("mob");
                                if (score - 500 >= 0)
                                    score -= 200;
                                else
                                    score = 0;
                                scene6.deleteAllObjects("score");
                                scene6.createText(score, "score", "green", "36px consolas bold", 1, 0, 10, 30, true, false, 0, 0, false, false, 100);
                                setTimeout(function ()
                                {
                                    for (var i = 0; i < 50; i++)
                                    {
                                        scene6.loadImage("mob_3.png", "mob", 1, 0, 0, 0, -1, -1, 400, 150, -1, -1, "auto", (Math.random() * 5) + 10, (Math.random() * 5) + 5, true, false);
                                    }
                                }, 5000);
                            });
                        }
                    });
                    for (var i = 0; i < 50; i++)
                    {
                        scene6.loadImage("mob_3.png", "mob", 1, 0, 0, 0, -1, -1, 400, 150, -1, -1, "auto", (Math.random() * 5) + 10, (Math.random() * 5) + 5, true, false);
                    }
                });
            });
            var scene7 = game.addScene("scene7", 40);
            scene7.loadImage("brain.png", "background", 1, 0, 0, 0, -1, -1, 0, 0, game_canvas.width, game_canvas.height, "auto", 0, 0, true, false, function ()
            {
                scene7.loadImage("mario.png", "actor", 1, 0, 0, 0, -1, -1, 300, 250, -1, -1, "auto", 0, 0, true, false, function ()
                {
                    scene7.loadImage("mario_reverse.png", "actor_reverse", 0, 0, 0, 0, -1, -1, 300, 250, -1, -1, "auto", 0, 0, true, false);
                    scene7.loadImage("boss_reverse.png", "boss_reverse", 1, 0, 0, 0, -1, -1, 720, 250, -1, -1, "auto", 0, 0, true, false, function ()
                    {
                        scene7.createCircle("boss_talk", "white", 0, fadeSpeed, 650, 400, 1, 0.5, 150, 0, Math.PI * 2, true, true, 0, 0, true, true);
                        scene7.createText("Mario you finally came i was getting worried that you might " +
                                "be lost, HA HA HA .", "boss_talk_text", "green", "14px consolas", 0, textSpeed, 530, 170, true, false, 0, 0, true, true, 180);
                        scene7.createCircle("mario_talk", "white", 0, fadeSpeed, 150, 400, 1, 0.5, 150, 0, Math.PI * 2, true, true, 0, 0, true, true);
                        scene7.createText("Well, i am here now release the princess bowser or else.. ", "mario_talk_text", "green", "14px consolas", 0, textSpeed, 30, 170, true, false, 0, 0, true, true, 180);
                        scene7.createCircle("boss_talk", "white", 0, fadeSpeed, 650, 400, 1, 0.5, 150, 0, Math.PI * 2, true, true, 0, 0, true, true);
                        scene7.createText("Or else what, take a look around you, MWAHAHAHAHAHAHA", "boss_talk_text", "green", "14px consolas", 0, textSpeed, 530, 170, true, false, 0, 0, true, true, 180);
                        scene7.loadImage("mob_2_reverse.png", "mob", 0, 0.01, 0, 0, -1, -1, 200, 0, -1, -1, "auto", 0, 0, true, false);
                        scene7.loadImage("mob_2_reverse.png", "mob", 0, 0.01, 0, 0, -1, -1, 200, 50, -1, -1, "auto", 0, 0, true, false);
                        scene7.loadImage("mob_2_reverse.png", "mob", 0, 0.01, 0, 0, -1, -1, 200, 100, -1, -1, "auto", 0, 0, true, false);
                        scene7.loadImage("mob_2_reverse.png", "mob", 0, 0.01, 0, 0, -1, -1, 200, 150, -1, -1, "auto", 0, 0, true, false);
                        scene7.loadImage("mob_2_reverse.png", "mob", 0, 0.01, 0, 0, -1, -1, 200, 200, -1, -1, "auto", 0, 0, true, false);
                        scene7.loadImage("mob_2_reverse.png", "mob", 0, 0.01, 0, 0, -1, -1, 200, 250, -1, -1, "auto", 0, 0, true, false);
                        scene7.loadImage("mob_2_reverse.png", "mob", 0, 0.01, 0, 0, -1, -1, 200, 300, -1, -1, "auto", 0, 0, true, false);
                        scene7.loadImage("mob_2_reverse.png", "mob", 0, 0.01, 0, 0, -1, -1, 200, 350, -1, -1, "auto", 0, 0, true, false);
                        scene7.loadImage("mob_2_reverse.png", "mob", 0, 0.01, 0, 0, -1, -1, 200, 400, -1, -1, "auto", 0, 0, true, false);
                        scene7.loadImage("mob_2_reverse.png", "mob", 0, 0.01, 0, 0, -1, -1, 200, 450, -1, -1, "auto", 0, 0, true, false, function ()
                        {
                            scene7.loadImage("mob_2.png", "mob", 0, 0.01, 0, 0, -1, -1, 400, 0, -1, -1, "auto", 0, 0, true, false);
                            scene7.loadImage("mob_2.png", "mob", 0, 0.01, 0, 0, -1, -1, 400, 50, -1, -1, "auto", 0, 0, true, false);
                            scene7.loadImage("mob_2.png", "mob", 0, 0.01, 0, 0, -1, -1, 400, 100, -1, -1, "auto", 0, 0, true, false);
                            scene7.loadImage("mob_2.png", "mob", 0, 0.01, 0, 0, -1, -1, 400, 150, -1, -1, "auto", 0, 0, true, false);
                            scene7.loadImage("mob_2.png", "mob", 0, 0.01, 0, 0, -1, -1, 400, 200, -1, -1, "auto", 0, 0, true, false);
                            scene7.loadImage("mob_2.png", "mob", 0, 0.01, 0, 0, -1, -1, 400, 250, -1, -1, "auto", 0, 0, true, false);
                            scene7.loadImage("mob_2.png", "mob", 0, 0.01, 0, 0, -1, -1, 400, 300, -1, -1, "auto", 0, 0, true, false);
                            scene7.loadImage("mob_2.png", "mob", 0, 0.01, 0, 0, -1, -1, 400, 350, -1, -1, "auto", 0, 0, true, false);
                            scene7.loadImage("mob_2.png", "mob", 0, 0.01, 0, 0, -1, -1, 400, 400, -1, -1, "auto", 0, 0, true, false);
                            scene7.loadImage("mob_2.png", "mob", 0, 0.01, 0, 0, -1, -1, 400, 450, -1, -1, "auto", 0, 0, true, false, function ()
                            {
                                scene7.createCircle("mario_talk", "white", 0, fadeSpeed, 150, 400, 1, 0.5, 150, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                scene7.createText("What.. how did this happen luigi was supposed to watch my back, " +
                                        "what did you do to him bowser?", "mario_talk_text", "green", "14px consolas", 0, textSpeed, 30, 170, true, false, 0, 0, true, true, 180);
                                scene7.createCircle("boss_talk", "white", 0, fadeSpeed, 650, 400, 1, 0.5, 150, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                scene7.createText("Me, i did nothing it is what he has done to you " +
                                        "that is what you should be asking.", "boss_talk_text", "green", "14px consolas", 0, textSpeed, 530, 170, true, false, 0, 0, true, true, 180);
                                scene7.createCircle("mario_talk", "white", 0, fadeSpeed, 150, 400, 1, 0.5, 150, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                scene7.createText("What do you mean???????????", "mario_talk_text", "green", "14px consolas", 0, textSpeed, 30, 170, true, false, 0, 0, true, true, 180);
                                scene7.createCircle("boss_talk", "white", 0, fadeSpeed, 650, 400, 1, 0.5, 150, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                scene7.createText("Why dont you ask him", "boss_talk_text", "green", "14px consolas", 0, textSpeed, 530, 170, true, false, 0, 0, true, true, 180, function ()
                                {
                                    scene7.scheduleSound("luigi_reverse", "game_song_4.mp3", true);
                                    scene7.loadImage("Luigi_reverse.png", "luigi_reverse", 0, 0.01, 0, 0, -1, -1, 750, 400, -1, -1, "auto", 0, 0, true, false, function ()
                                    {
                                        scene7.createCircle("luigi_talk", "white", 0, fadeSpeed, 550, 800, 1, 0.5, 170, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                        scene7.createText("Hi mario.", "luigi_talk_text", "green", "14px consolas", 0, textSpeed, 430, 360, true, false, 0, 0, true, true, 180);
                                        scene7.createCircle("mario_talk", "white", 0, fadeSpeed, 150, 400, 1, 0.5, 150, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                        scene7.createText("Luigi!! what are you doing here.", "mario_talk_text", "green", "14px consolas", 0, textSpeed, 30, 170, true, false, 0, 0, true, true, 180);
                                        scene7.createCircle("boss_talk", "white", 0, fadeSpeed, 650, 400, 1, 0.5, 150, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                        scene7.createText("Luigi has been working for me since the start, how do you like that mario.", "boss_talk_text", "green", "14px consolas", 0, textSpeed, 530, 170, true, false, 0, 0, true, true, 180);
                                        scene7.createCircle("mario_talk", "white", 0, fadeSpeed, 150, 400, 1, 0.5, 150, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                        scene7.createText("Luigi is this true ???", "mario_talk_text", "green", "14px consolas", 0, textSpeed, 30, 170, true, false, 0, 0, true, true, 180);
                                        scene7.createCircle("luigi_talk", "white", 0, fadeSpeed, 550, 800, 1, 0.5, 170, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                        scene7.createText("Of coarse it is, i practically lead you all the way " +
                                                "here, did you think i wanted to be a plumber for the rest of " +
                                                "my life?, HAA. bowser has big plans but in order to achieve them " +
                                                "he needed both you and peach.", "luigi_talk_text", "green", "14px consolas", 0, textSpeed, 430, 360, true, false, 0, 0, true, true, 180);
                                        scene7.createCircle("mario_talk", "white", 0, fadeSpeed, 150, 400, 1, 0.5, 150, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                        scene7.createText("Me and peach ! I dont understand how do we fit your " +
                                                "plan for world domination ??", "mario_talk_text", "green", "14px consolas", 0, textSpeed, 30, 170, true, false, 0, 0, true, true, 180);
                                        scene7.createCircle("boss_talk", "white", 0, fadeSpeed, 650, 400, 1, 0.5, 150, 0, Math.PI * 2, true, true, 0, 0, true, true);
                                        scene7.createText("You will learn soon enough, MWAHAHAHAHAHAHAHAHAHA", "boss_talk_text", "green", "14px consolas", 0, textSpeed, 530, 170, true, false, 0, 0, true, true, 180);
                                        scene7.createRect("white_rect", "white", 0, fadeSpeed, 0, 0, game_canvas.width, game_canvas.height, true, false, "auto", 0, 0, true, function ()
                                        {
                                            scene7.createText("What did bowser mean?, What will be the fate of mario and princess peach?, will " +
                                                    "luigi's treason go unpunished?, stay tuned for the next lesson's scenario of 'SCIENCE WITH FUN'", "luigi_talk_text", "green", "24px consolas", 0, textSpeed, 200, 200, true, false, 0, 0, true, true, 300);
                                            scene7.loadImage("arrow.png", "arrow", 0, 0.1, 0, 0, -1, -1, 720, 390, -1, -1, "pointer", 0, 0, true, false, function ()
                                            {
                                                scene7.registerEventHandler("arrow", "onclick", function ()
                                                {
                                                    game.nextScene();
                                                });
                                            });
                                        });
                                    });
                                });
                            });
                        });
                    });
                });
            });
            var credits = game.addScene("credits", 40);
            credits.scheduleSound("background", "credits_song.mp3", true);
            credits.loadImage("credits_background.jpg", "background", 1, 0, 0, 0, -1, -1, 0, 0, game_canvas.width, game_canvas.height, "auto", 0, 0, true, false, function ()
            {
                credits.loadImage("questions_button.png", "to_questions", 0, 0.1, 0, 0, -1, -1, 710, 20, -1, -1, "pointer", 0, 0, true, false, function ()
                {
                    credits.registerEventHandler("to_questions", "onmouseover", function ()
                    {
                        credits.getObjectById("to_questions").initialAlpha = 0.5;
                    });
                    credits.registerEventHandler("to_questions", "onmouseout", function ()
                    {
                        credits.getObjectById("to_questions").initialAlpha = 1;
                    });
                    credits.registerEventHandler("to_questions", "onclick", function ()
                    {
                        window.location = "questions.html";
                    });
                    credits.createText("Thank you for playing 'SCIENCE WITH FUN' We hope you had fun :)", "luigi_talk_text", "blue", "18px consolas", 0, textSpeed, 10, 30, true, false, 0, 0, true, true, 600);
                    credits.createText("Development team (Semper fi=forever faithful)", "luigi_talk_text", "blue", "18px consolas", 0, textSpeed, 10, 60, true, false, 0, 0, true, true, 600);
                    credits.createText("Abdelrahman Elshafei: Graphics Engine & some sound assets", "luigi_talk_text", "blue", "18px consolas", 0, textSpeed, 10, 80, true, false, 0, 0, true, true, 600);
                    credits.createText("Mohammed Abdelhakim : Graphical & sound assets", "luigi_talk_text", "blue", "18px consolas", 0, textSpeed, 10, 100, true, false, 0, 0, true, true, 600);
                    credits.createText("Atef Tosson         : Debugger", "luigi_talk_text", "blue", "18px consolas", 0, textSpeed, 10, 120, true, false, 0, 0, true, true, 600);
                    credits.createText("Hassan Elfar        : extra functionalities", "luigi_talk_text", "blue", "18px consolas", 0, textSpeed, 10, 140, true, false, 0, 0, true, true, 600);
                    credits.createText("Mahmoud Salah       : extra functionalities", "luigi_talk_text", "blue", "18px consolas", 0, textSpeed, 10, 160, true, false, 0, 0, true, true, 600);
                    credits.createText("All artwork and soundwork related to Super mario brothers and Dragonball are " +
                            "a property of their respective owners All rights reserved.", "luigi_talk_text", "blue", "18px consolas", 0, textSpeed, 530, 300, true, false, 0, 0, true, true, 200);
                    var startX = -100;
                    credits.loadImage("princess.png", "background", 1, 0, 0, 0, -1, -1, startX, 400, -1, -1, "auto", 1, 0, false, false);
                    credits.loadImage("Luigi.png", "background", 1, 0, 0, 0, -1, -1, startX - 200, 400, -1, -1, "auto", 1, 0, false, false);
                    credits.loadImage("mario.png", "background", 1, 0, 0, 0, -1, -1, startX - 400, 400, -1, -1, "auto", 1, 0, false, false);
                    credits.loadImage("boss.png", "background", 1, 0, 0, 0, -1, -1, startX - 600, 400, -1, -1, "auto", 1, 0, false, false);
                });
            });
            game.startGame();
        }
);
</script>
</body>
</html>